﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ClassLibrary.DAO;
using ClassLibrary.Entitty;

public partial class Admin_ucControl_listNoidung : System.Web.UI.UserControl
{
    TblNoiDungDAO noidungDAO = new TblNoiDungDAO(Global.CONNECTION_STRING);

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadTieuDe();
        }
    }

    private void LoadTieuDe()
    {
        DataTable dt = noidungDAO.GetAllTieuDe();
        GridView1.DataSource = dt;
        GridView1.DataBind();
    }


    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {

            //HiddenField hidItemID = (HiddenField)e.Row.Cells[1].FindControl("hidItemID");
        //    DataTable dt = noidungDAO.GetAllTieuDe();
           // Label lb = (Label)e.Row.Cells[1].FindControl("Noidung");
            //Label menuName = (Label)e.Row.Cells[2].FindControl("danhmuc");

            //foreach (DataRow dr in dt.Rows)
           // {
            //    lb.Text = Server.HtmlDecode(dr["Noidung"].ToString());
          //     // menuName.Text = dr["MenuName"].ToString();
          //  }

        }
    }
}
